<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--Request Resource Page v1.0  -->
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">



<ui:composition template="/WEB-INF/template/template.xhtml">
	<ui:define name="content">
		<h:form>
		<br/>
			<div class="middle">
				<h3><h:outputText value="#{msg.BU_requestResources_header}" /></h3>
				<h:messages class="myError" id="errorMessage" 
					showSummary="true" showDetail="false"></h:messages>
				
				 <h:outputText value="#{requestResourceBean.confirmMessage}" id="confMess"
                                        color="#890120"></h:outputText>
			</div>



			<h:panelGrid class="panelGrid" border="0" columns="3">
				<h:outputText value="#{msg.BU_requestResources_resource}" />
				<h:selectOneMenu id="select" required="true"
					requiredMessage="#{msg.BU_requestResources_reqMessage1}"
					valueChangeListener="#{requestResourceBean.resourceChangeListener}">
					<f:selectItems value="#{requestResourceBean.resources}" var="r"
						itemValue="#{r.id}" itemLabel="#{r.name}" />
				</h:selectOneMenu>
				<h:outputText></h:outputText>
				<h:outputText value="#{msg.BU_requestResources_quantity}"></h:outputText>


				<h:inputText id="quantity" value="#{requestResourceBean.quantity}"
					valueChangeListener="#{requestResourceBean.quantityValueChanged}" required="true"
					requiredMessage="#{msg.BU_requestResources_reqMessage2}" label="Quantity"
					size="5">
					<f:validator validatorId="validators.RequestResourceValidator" />
					<f:ajax render="confMess rRequestB1" ></f:ajax>
				</h:inputText>

				<h:selectOneMenu id="um" required="true"
					requiredMessage="#{msg.BU_requestResources_reqMessage3}"
					valueChangeListener="#{requestResourceBean.quantityTypeChangeListener}">
					<f:selectItems value="#{requestResourceBean.umdtos}" var="u"
						itemValue="#{u.id}" itemLabel="#{u.name}" />

				</h:selectOneMenu>

				<h:outputText value="#{msg.BU_requestResources_description}"></h:outputText>
				<h:inputTextarea id="description"
					value="#{requestResourceBean.description}" cols="3" rows="2"
					style="resize:none" >
					<f:ajax render="confMess rRequestB1"></f:ajax>
					</h:inputTextarea>
				<h:outputText></h:outputText>
				<h:outputText></h:outputText>

			</h:panelGrid>
			<br />
			<br />

			<div class="middle">
				<h:commandButton id="rRequestB1"
					value="#{msg.BU_requestResources_sendButton}" class="button" disabled="#{not requestResourceBean.allowSendRequest}"
					actionListener="#{requestResourceBean.sendRequest}" />

				<h:commandButton value="#{msg.BU_requestResources_viewButton}"
					actionListener="#{requestResourceBean.goToHistory}"
					immediate="true" class="button"></h:commandButton>
			</div>
		</h:form>
	</ui:define>
</ui:composition>

</html>